#ifndef MYTHREAD_H
#define MYTHREAD_H
#include<QThread>
#include<QMutex>
#include<QDebug>

class MyThread:public QThread
{
    Q_OBJECT;
public:
    explicit MyThread(QObject* parent = nullptr);
    void run() override;
private:
    static QMutex mutex;//多线程使用一把锁
    static int num;//多线程访问一个数据
};

#endif // MYTHREAD_H
